#pragma once
#include "framework.h"

class ScreenshotWnd : public DuiLib::WindowImplBase
{
public:
  enum SHUTSTATE
  {
    eNotShut =0,
    eShuting = 1,
    eShuted = 2
  };

  ScreenshotWnd();
  ~ScreenshotWnd();

  virtual DuiLib::CDuiString GetSkinFolder();
  virtual DuiLib::CDuiString GetSkinFile();
  virtual DuiLib::UILIB_RESOURCETYPE GetResourceType() const;
  virtual LPCTSTR GetResourceID() const;

  virtual LPCTSTR GetWindowClassName(void) const;

  virtual LRESULT ResponseDefaultKeyEvent(WPARAM wParam);

  virtual void InitWindow();
  virtual LRESULT HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);

  virtual LRESULT OnClose(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled);
protected:
  void ReInitControls();
  void ResetShutState();
  void UpdateBk();

  RECT DetectionNearWnd();

  void ActiveWnd();
  void ScreenshotDesktop();
  void Tray();
  void TrayMenu();

  void SeleRegion(RECT rc);
private:
  DuiLib::CLabelUI* m_bgCtr;
  DuiLib::CControlUI* m_selRegion;

  BOOL  m_bTrigger;
  SHUTSTATE  m_eShutState;
  int m_HotKeyId;

  HCURSOR m_hCursor;
  HCURSOR m_hOldCursor;
  HBITMAP m_hOriginalPaint;
  HBITMAP m_hDarkeningOriginal;
  HBITMAP m_testSel;
  
  HMENU m_hMenu;

  UINT WM_TRAYMSG;
  POINT m_ptStart;
  POINT m_ptEnd;
};
